﻿<phone:PhoneApplicationPage 
    x:Class="SpeedRun.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit"
    mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="CornflowerBlue" 
    SupportedOrientations="Portrait" Orientation="Portrait"
    shell:SystemTray.ForegroundColor="CornflowerBlue"
    xmlns:pivot="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
    shell:SystemTray.IsVisible="True">
    
    <Grid x:Name="LayoutRoot" Background="Black" Loaded="LayoutRoot_Loaded" Unloaded="LayoutRoot_Unloaded" >
        <ProgressBar IsIndeterminate="True" Visibility="Collapsed" VerticalAlignment="Top" Height="10" x:Name="progressBar" />       
        <Canvas Width="75" Height="75" Margin="0,3,3,0" HorizontalAlignment="Right" VerticalAlignment="Top" >
            <Ellipse Height="45" Width="45" Canvas.Left="15" x:Name="indicator" Canvas.Top="15" Fill="Red" VerticalAlignment="Center" HorizontalAlignment="Center" />
        </Canvas>
   
            <Grid Height="337" HorizontalAlignment="Center" Margin="0,120,0,0" VerticalAlignment="Top" Width="480" >
            <pivot:Panorama>
                <pivot:PanoramaItem Header="History" Loaded="PanoramaItem_Loaded">
                    <ScrollViewer>
                        <Grid>
                            <Border BorderThickness="2" BorderBrush="Wheat">
                            <StackPanel x:Name="stp1Pan">
                                    <Border BorderThickness="2" BorderBrush="Wheat">
                                         <TextBlock x:Name="historyTime" Text="00:00:00" TextAlignment="Center" FontSize="65" />
                                    </Border>
                                    <Border BorderThickness="2" BorderBrush="Wheat">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="Type" Width="140" />
                                            <TextBlock Text="Distance" Width="140" />
                                            <TextBlock Text="Cal"  Width="140"/>
                                        </StackPanel>
                                    </Border>
                                    <Border BorderThickness="2" BorderBrush="Wheat">
                                        <StackPanel Orientation="Horizontal">
                                            <TextBlock Text="Type of Run" x:Name="historyType" Width="140" />
                                            <TextBlock Text="0 meters" x:Name="historyDistance" Width="140"/>
                                            <TextBlock Text="0 KCalories" x:Name="historyCal" Width="140"/>
                                        </StackPanel>
                                    </Border>
                                    <Border BorderThickness="2" BorderBrush="Wheat">
                                        <TextBlock x:Name="HistortTimeStamp" Text="Last Workout : None" FontSize="25" />
                                    </Border>
                                    <Border BorderThickness="2" BorderBrush="Wheat">
                                        <TextBlock x:Name="total" Text="Total Runs: None" />
                                    </Border>
                                    <Button Content="Complete History" Click="Button_Click_4" />
                                </StackPanel>
                            </Border>
                        </Grid>
                    </ScrollViewer>
                </pivot:PanoramaItem>
                <pivot:PanoramaItem Header="Info" >
                    <StackPanel x:Name="alt" Visibility="Collapsed" >
                        <StackPanel Orientation="Horizontal" Visibility="Visible">
                            <TextBlock Text="Coordinates : "  FontSize="28"  TextAlignment="Center"/>
                            <TextBlock x:Name="currentLocation" FontSize="28" TextAlignment="Center"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" Visibility="Visible">
                            <TextBlock Text="Current Speed : "  FontSize="28"  TextAlignment="Center"/>
                            <TextBlock x:Name="currentSpeed"  FontSize="28"  TextAlignment="Center"/>
                        </StackPanel>
                        <StackPanel Orientation="Horizontal" >
                            <TextBlock Text="Altitude : "  FontSize="28" x:Name="alt1" Visibility="Visible"/>
                            <TextBlock x:Name="currentAltitude"  FontSize="28" />
                        </StackPanel>

                        <StackPanel Visibility="Collapsed" x:Name="summary">
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="AverageSpeed : "  FontSize="28" />
                                <TextBlock Name="avgSpeed"  FontSize="28" />
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Disance : "  FontSize="28" />
                                <TextBlock Name="distance"  FontSize="28" />
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Calories : "  FontSize="28" />
                                <TextBlock Name="cal"  FontSize="28" />
                            </StackPanel>
                            <StackPanel Orientation="Horizontal">
                                <TextBlock Text="Maximum Speed : "  FontSize="28" />
                                <TextBlock Name="maxSpeed"  FontSize="28"  />
                            </StackPanel>
                        </StackPanel>
                    </StackPanel>
                </pivot:PanoramaItem>
            </pivot:Panorama>
            </Grid>
      
      
            <Grid x:Name="runningOff" Background="Black" Height="300" VerticalAlignment="Bottom" Margin="0,0" Visibility="Visible">
                <StackPanel Margin="0,0,0,0">
                    <Button Content="Quick Run" Width="300" Click="Button_Click_3" Foreground="CornflowerBlue" BorderBrush="CornflowerBlue" />
                    <Button Content="Start Workout" Width="300" Click="Button_Click_1" Foreground="CornflowerBlue" BorderBrush="CornflowerBlue"  />
                    <Button Content="Change Settings" Width="300" Click="Button_Click_2"  Foreground="CornflowerBlue" BorderBrush="CornflowerBlue" />
                </StackPanel>
                <TextBlock Name="statusMsg" Text="Status" Margin="401,-388,-1,661" TextAlignment="Center" />
            </Grid>
        
        <!--<Grid x:Name="runningOn" Background="Black" Height="300" VerticalAlignment="Bottom" Margin="0,0" Visibility="Collapsed">
                <ScrollViewer>
                    <StackPanel>
                            <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Height="180">
                                <Image Hold="Image_Hold_1" Tap="rr_Tap" Source="Images/appbar.control.rewind.png" Width="75" Height="75" Margin="10" />
                        <Image Visibility="Collapsed" x:Name="Stop" Tap="Image_Tap" Source="Images/appbar.control.stop.png" Width="150" Height="150" Margin="10" ImageFailed="Image_ImageFailed">
                            
                        </Image>
                            <Image x:Name="playImage" Tap="Image_Tap" Source="Images/appbar.transport.play.rest.png" Width="75" Height="75" Margin="10" ImageFailed="Image_ImageFailed">
                            <Image.RenderTransform>
                                <CompositeTransform x:Name="transform" />
                            </Image.RenderTransform>
                        </Image>
                            <Image Hold="Image_Hold" Tap="ff_Tap" Source="Images/appbar.control.fastforward.png" Width="75" Height="75" Margin="10" />
                            </StackPanel>
                            <TextBlock Name="songName" TextAlignment="Center" TextWrapping="Wrap" />                
                            <Slider Orientation="Horizontal" Height="40" Foreground="White" Background="White"/>
                            <TextBlock Text="" x:Name="programInfo" />
                            <Button Content="Settings" Click="Button_Click" Width="250" />
                    </StackPanel>
                </ScrollViewer>
            <TextBlock  FontSize="60" TextAlignment="Center" Height="79" HorizontalAlignment="Center" Margin="0,-86,0,0" Name="time" Text="" VerticalAlignment="Top" Width="480" OpacityMask="#FF6C5050" Padding="1" />
            </Grid>-->
        <TextBlock FontSize="75" Height="90" HorizontalAlignment="Left" Margin="0,20,0,0" Name="textBlock1" Text="Speed Run" VerticalAlignment="Top" Width="403" />
    </Grid>
 
    <!--Sample code showing usage of ApplicationBar-->
    <phone:PhoneApplicationPage.ApplicationBar >
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True" BackgroundColor="CornflowerBlue" Opacity="0.85">
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.location.png" Text="Location" Click="ApplicationBarIconButton_Click"/>
            <shell:ApplicationBarIconButton IconUri="/Images/appbar.location.circle.png" Text="Track Me" Click="ApplicationBarIconButton_Click_1"/>
            <shell:ApplicationBar.MenuItems>
                <shell:ApplicationBarMenuItem Text="Feedback" Click="ApplicationBarMenuItem_Click" />
                <shell:ApplicationBarMenuItem Text="Rate and Review" Click="ApplicationBarMenuItem_Click_1"/>
                <shell:ApplicationBarMenuItem Text="More from this developer" Click="ApplicationBarMenuItem_Click_2" />
            </shell:ApplicationBar.MenuItems>
        </shell:ApplicationBar>
        
      </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>